class Solution
{
public:
    int getMaximumConsecutive(vector<int> &coins)
    {
        int maxResult = 1;
        sort(coins.begin(), coins.end());
        for (auto &coin : coins)
        {
            if (coin > maxResult)
            {
                break;
            }
            maxResult += coin;
        }
        return maxResult;
    }
};